$(function(){
	var url = path + "/userServlet";
	$("input[name='idCard']").keyup(function(){
		var idCard = $(this).val();
		var method = "Check";
		$.ajax({
			url:path + '/userServlet',
			type:'post',
			data:{
				idCard:idCard,
				method:method
			},
			
			success:function(data){
				var mark = $("#mark");
				var submit = $("input[type='submit']");
				var form = $("form");
				
				if(data == "true"){
					mark.attr("class","error");
					mark.html("身份证号已存在");
					submit.attr("disabled","disabled");
					form.removeAttr("action");
				}else{
					mark.attr("class","access");
					mark.html("恭喜!身份证可用");
					submit.removeAttr("disabled");
					form.attr("action",url);
				}
			},
			error:function(arg1,arg2,arg3){
				
			}
		})
	})
})